﻿using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;

namespace ParkManagement
{
    /// <summary>
    /// 纠错管理类
    /// </summary>
    public class CorrectManager:DomainService
    {
        private readonly IRepository<Correct, int> _correctRepository;

        public CorrectManager(
            IRepository<Correct, int> correctRepository)
        {
            _correctRepository = correctRepository;
        }

        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="name"></param>
        /// <param name="photo"></param>
        /// <param name="content"></param>
        /// <param name="remark"></param>
        /// <param name="spotCount"></param>
        public async Task<Correct> CreateAsync(
            [NotNull] string name,
            [NotNull] string photo,
            [NotNull] string content,
            [NotNull] string remark,
            int spotCount)
        {
            return await _correctRepository.InsertAsync(
                new Correct(
                    name,
                    photo,
                    content,
                    remark,
                    spotCount
                )
            );
        }
    }
}